import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/hidden_danger_investigation_ledger_entity.dart';

HiddenDangerInvestigationLedgerEntity $HiddenDangerInvestigationLedgerEntityFromJson(Map<String, dynamic> json) {
  final HiddenDangerInvestigationLedgerEntity hiddenDangerInvestigationLedgerEntity = HiddenDangerInvestigationLedgerEntity();
  final List<HiddenDangerInvestigationLedgerRecords>? records = (json['records'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<HiddenDangerInvestigationLedgerRecords>(e) as HiddenDangerInvestigationLedgerRecords).toList();
  if (records != null) {
    hiddenDangerInvestigationLedgerEntity.records = records;
  }
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    hiddenDangerInvestigationLedgerEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    hiddenDangerInvestigationLedgerEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    hiddenDangerInvestigationLedgerEntity.current = current;
  }
  final List<dynamic>? orders = (json['orders'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (orders != null) {
    hiddenDangerInvestigationLedgerEntity.orders = orders;
  }
  final bool? optimizeCountSql = jsonConvert.convert<bool>(json['optimizeCountSql']);
  if (optimizeCountSql != null) {
    hiddenDangerInvestigationLedgerEntity.optimizeCountSql = optimizeCountSql;
  }
  final bool? searchCount = jsonConvert.convert<bool>(json['searchCount']);
  if (searchCount != null) {
    hiddenDangerInvestigationLedgerEntity.searchCount = searchCount;
  }
  final dynamic countId = json['countId'];
  if (countId != null) {
    hiddenDangerInvestigationLedgerEntity.countId = countId;
  }
  final dynamic maxLimit = json['maxLimit'];
  if (maxLimit != null) {
    hiddenDangerInvestigationLedgerEntity.maxLimit = maxLimit;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    hiddenDangerInvestigationLedgerEntity.pages = pages;
  }
  return hiddenDangerInvestigationLedgerEntity;
}

Map<String, dynamic> $HiddenDangerInvestigationLedgerEntityToJson(HiddenDangerInvestigationLedgerEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['records'] = entity.records?.map((v) => v.toJson()).toList();
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['orders'] = entity.orders;
  data['optimizeCountSql'] = entity.optimizeCountSql;
  data['searchCount'] = entity.searchCount;
  data['countId'] = entity.countId;
  data['maxLimit'] = entity.maxLimit;
  data['pages'] = entity.pages;
  return data;
}

extension HiddenDangerInvestigationLedgerEntityExtension on HiddenDangerInvestigationLedgerEntity {
  HiddenDangerInvestigationLedgerEntity copyWith({
    List<HiddenDangerInvestigationLedgerRecords>? records,
    int? total,
    int? size,
    int? current,
    List<dynamic>? orders,
    bool? optimizeCountSql,
    bool? searchCount,
    dynamic countId,
    dynamic maxLimit,
    int? pages,
  }) {
    return HiddenDangerInvestigationLedgerEntity()
      ..records = records ?? this.records
      ..total = total ?? this.total
      ..size = size ?? this.size
      ..current = current ?? this.current
      ..orders = orders ?? this.orders
      ..optimizeCountSql = optimizeCountSql ?? this.optimizeCountSql
      ..searchCount = searchCount ?? this.searchCount
      ..countId = countId ?? this.countId
      ..maxLimit = maxLimit ?? this.maxLimit
      ..pages = pages ?? this.pages;
  }
}

HiddenDangerInvestigationLedgerRecords $HiddenDangerInvestigationLedgerRecordsFromJson(Map<String, dynamic> json) {
  final HiddenDangerInvestigationLedgerRecords hiddenDangerInvestigationLedgerRecords = HiddenDangerInvestigationLedgerRecords();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hiddenDangerInvestigationLedgerRecords.id = id;
  }
  final String? planName = jsonConvert.convert<String>(json['planName']);
  if (planName != null) {
    hiddenDangerInvestigationLedgerRecords.planName = planName;
  }
  final String? inspectionDepartment = jsonConvert.convert<String>(json['inspectionDepartment']);
  if (inspectionDepartment != null) {
    hiddenDangerInvestigationLedgerRecords.inspectionDepartment = inspectionDepartment;
  }
  final String? inspectionDepartmentName = jsonConvert.convert<String>(json['inspectionDepartmentName']);
  if (inspectionDepartmentName != null) {
    hiddenDangerInvestigationLedgerRecords.inspectionDepartmentName = inspectionDepartmentName;
  }
  final String? inspectionType = jsonConvert.convert<String>(json['inspectionType']);
  if (inspectionType != null) {
    hiddenDangerInvestigationLedgerRecords.inspectionType = inspectionType;
  }
  final dynamic workDayType = json['workDayType'];
  if (workDayType != null) {
    hiddenDangerInvestigationLedgerRecords.workDayType = workDayType;
  }
  final dynamic locateMode = json['locateMode'];
  if (locateMode != null) {
    hiddenDangerInvestigationLedgerRecords.locateMode = locateMode;
  }
  final dynamic allowCrossInspection = json['allowCrossInspection'];
  if (allowCrossInspection != null) {
    hiddenDangerInvestigationLedgerRecords.allowCrossInspection = allowCrossInspection;
  }
  final dynamic doesItExist = json['doesItExist'];
  if (doesItExist != null) {
    hiddenDangerInvestigationLedgerRecords.doesItExist = doesItExist;
  }
  final dynamic inspectionPersonnel = json['inspectionPersonnel'];
  if (inspectionPersonnel != null) {
    hiddenDangerInvestigationLedgerRecords.inspectionPersonnel = inspectionPersonnel;
  }
  final dynamic inspectionPersonnelName = json['inspectionPersonnelName'];
  if (inspectionPersonnelName != null) {
    hiddenDangerInvestigationLedgerRecords.inspectionPersonnelName = inspectionPersonnelName;
  }
  final dynamic createDate = json['createDate'];
  if (createDate != null) {
    hiddenDangerInvestigationLedgerRecords.createDate = createDate;
  }
  final dynamic updateDate = json['updateDate'];
  if (updateDate != null) {
    hiddenDangerInvestigationLedgerRecords.updateDate = updateDate;
  }
  final dynamic createBy = json['createBy'];
  if (createBy != null) {
    hiddenDangerInvestigationLedgerRecords.createBy = createBy;
  }
  final dynamic updateBy = json['updateBy'];
  if (updateBy != null) {
    hiddenDangerInvestigationLedgerRecords.updateBy = updateBy;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    hiddenDangerInvestigationLedgerRecords.createById = createById;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    hiddenDangerInvestigationLedgerRecords.updateById = updateById;
  }
  final dynamic deleted = json['deleted'];
  if (deleted != null) {
    hiddenDangerInvestigationLedgerRecords.deleted = deleted;
  }
  final dynamic enableOrNot = json['enableOrNot'];
  if (enableOrNot != null) {
    hiddenDangerInvestigationLedgerRecords.enableOrNot = enableOrNot;
  }
  final dynamic scheduledStartTime = json['scheduledStartTime'];
  if (scheduledStartTime != null) {
    hiddenDangerInvestigationLedgerRecords.scheduledStartTime = scheduledStartTime;
  }
  final dynamic plannedEndTime = json['plannedEndTime'];
  if (plannedEndTime != null) {
    hiddenDangerInvestigationLedgerRecords.plannedEndTime = plannedEndTime;
  }
  final dynamic taskGrade = json['taskGrade'];
  if (taskGrade != null) {
    hiddenDangerInvestigationLedgerRecords.taskGrade = taskGrade;
  }
  final dynamic companyCode = json['companyCode'];
  if (companyCode != null) {
    hiddenDangerInvestigationLedgerRecords.companyCode = companyCode;
  }
  final dynamic taskIds = json['taskIds'];
  if (taskIds != null) {
    hiddenDangerInvestigationLedgerRecords.taskIds = taskIds;
  }
  final int? checkType = jsonConvert.convert<int>(json['checkType']);
  if (checkType != null) {
    hiddenDangerInvestigationLedgerRecords.checkType = checkType;
  }
  final int? numberOfPoints = jsonConvert.convert<int>(json['numberOfPoints']);
  if (numberOfPoints != null) {
    hiddenDangerInvestigationLedgerRecords.numberOfPoints = numberOfPoints;
  }
  final int? taskNum = jsonConvert.convert<int>(json['taskNum']);
  if (taskNum != null) {
    hiddenDangerInvestigationLedgerRecords.taskNum = taskNum;
  }
  final int? numberOfHiddenHazardsNum = jsonConvert.convert<int>(json['numberOfHiddenHazardsNum']);
  if (numberOfHiddenHazardsNum != null) {
    hiddenDangerInvestigationLedgerRecords.numberOfHiddenHazardsNum = numberOfHiddenHazardsNum;
  }
  final int? completionRate = jsonConvert.convert<int>(json['completionRate']);
  if (completionRate != null) {
    hiddenDangerInvestigationLedgerRecords.completionRate = completionRate;
  }
  final int? theNumberOfTasksToBeCompleted = jsonConvert.convert<int>(json['theNumberOfTasksToBeCompleted']);
  if (theNumberOfTasksToBeCompleted != null) {
    hiddenDangerInvestigationLedgerRecords.theNumberOfTasksToBeCompleted = theNumberOfTasksToBeCompleted;
  }
  final int? taskStatus = jsonConvert.convert<int>(json['taskStatus']);
  if (taskStatus != null) {
    hiddenDangerInvestigationLedgerRecords.taskStatus = taskStatus;
  }
  final dynamic endTime = json['endTime'];
  if (endTime != null) {
    hiddenDangerInvestigationLedgerRecords.endTime = endTime;
  }
  final dynamic unitPlans = json['unitPlans'];
  if (unitPlans != null) {
    hiddenDangerInvestigationLedgerRecords.unitPlans = unitPlans;
  }
  final dynamic tasks = json['tasks'];
  if (tasks != null) {
    hiddenDangerInvestigationLedgerRecords.tasks = tasks;
  }
  final int? lateNum = jsonConvert.convert<int>(json['lateNum']);
  if (lateNum != null) {
    hiddenDangerInvestigationLedgerRecords.lateNum = lateNum;
  }
  final int? reExaminationNum = jsonConvert.convert<int>(json['reExaminationNum']);
  if (reExaminationNum != null) {
    hiddenDangerInvestigationLedgerRecords.reExaminationNum = reExaminationNum;
  }
  final String? inspectionTypeName = jsonConvert.convert<String>(json['inspectionTypeName']);
  if (inspectionTypeName != null) {
    hiddenDangerInvestigationLedgerRecords.inspectionTypeName = inspectionTypeName;
  }
  return hiddenDangerInvestigationLedgerRecords;
}

Map<String, dynamic> $HiddenDangerInvestigationLedgerRecordsToJson(HiddenDangerInvestigationLedgerRecords entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['planName'] = entity.planName;
  data['inspectionDepartment'] = entity.inspectionDepartment;
  data['inspectionDepartmentName'] = entity.inspectionDepartmentName;
  data['inspectionType'] = entity.inspectionType;
  data['workDayType'] = entity.workDayType;
  data['locateMode'] = entity.locateMode;
  data['allowCrossInspection'] = entity.allowCrossInspection;
  data['doesItExist'] = entity.doesItExist;
  data['inspectionPersonnel'] = entity.inspectionPersonnel;
  data['inspectionPersonnelName'] = entity.inspectionPersonnelName;
  data['createDate'] = entity.createDate;
  data['updateDate'] = entity.updateDate;
  data['createBy'] = entity.createBy;
  data['updateBy'] = entity.updateBy;
  data['createById'] = entity.createById;
  data['updateById'] = entity.updateById;
  data['deleted'] = entity.deleted;
  data['enableOrNot'] = entity.enableOrNot;
  data['scheduledStartTime'] = entity.scheduledStartTime;
  data['plannedEndTime'] = entity.plannedEndTime;
  data['taskGrade'] = entity.taskGrade;
  data['companyCode'] = entity.companyCode;
  data['taskIds'] = entity.taskIds;
  data['checkType'] = entity.checkType;
  data['numberOfPoints'] = entity.numberOfPoints;
  data['taskNum'] = entity.taskNum;
  data['numberOfHiddenHazardsNum'] = entity.numberOfHiddenHazardsNum;
  data['completionRate'] = entity.completionRate;
  data['theNumberOfTasksToBeCompleted'] = entity.theNumberOfTasksToBeCompleted;
  data['taskStatus'] = entity.taskStatus;
  data['endTime'] = entity.endTime;
  data['unitPlans'] = entity.unitPlans;
  data['tasks'] = entity.tasks;
  data['lateNum'] = entity.lateNum;
  data['reExaminationNum'] = entity.reExaminationNum;
  data['inspectionTypeName'] = entity.inspectionTypeName;
  return data;
}

extension HiddenDangerInvestigationLedgerRecordsExtension on HiddenDangerInvestigationLedgerRecords {
  HiddenDangerInvestigationLedgerRecords copyWith({
    String? id,
    String? planName,
    String? inspectionDepartment,
    String? inspectionDepartmentName,
    String? inspectionType,
    dynamic workDayType,
    dynamic locateMode,
    dynamic allowCrossInspection,
    dynamic doesItExist,
    dynamic inspectionPersonnel,
    dynamic inspectionPersonnelName,
    dynamic createDate,
    dynamic updateDate,
    dynamic createBy,
    dynamic updateBy,
    dynamic createById,
    dynamic updateById,
    dynamic deleted,
    dynamic enableOrNot,
    dynamic scheduledStartTime,
    dynamic plannedEndTime,
    dynamic taskGrade,
    dynamic companyCode,
    dynamic taskIds,
    int? checkType,
    int? numberOfPoints,
    int? taskNum,
    int? numberOfHiddenHazardsNum,
    int? completionRate,
    int? theNumberOfTasksToBeCompleted,
    int? taskStatus,
    dynamic endTime,
    dynamic unitPlans,
    dynamic tasks,
    int? lateNum,
    int? reExaminationNum,
    String? inspectionTypeName,
  }) {
    return HiddenDangerInvestigationLedgerRecords()
      ..id = id ?? this.id
      ..planName = planName ?? this.planName
      ..inspectionDepartment = inspectionDepartment ?? this.inspectionDepartment
      ..inspectionDepartmentName = inspectionDepartmentName ?? this.inspectionDepartmentName
      ..inspectionType = inspectionType ?? this.inspectionType
      ..workDayType = workDayType ?? this.workDayType
      ..locateMode = locateMode ?? this.locateMode
      ..allowCrossInspection = allowCrossInspection ?? this.allowCrossInspection
      ..doesItExist = doesItExist ?? this.doesItExist
      ..inspectionPersonnel = inspectionPersonnel ?? this.inspectionPersonnel
      ..inspectionPersonnelName = inspectionPersonnelName ?? this.inspectionPersonnelName
      ..createDate = createDate ?? this.createDate
      ..updateDate = updateDate ?? this.updateDate
      ..createBy = createBy ?? this.createBy
      ..updateBy = updateBy ?? this.updateBy
      ..createById = createById ?? this.createById
      ..updateById = updateById ?? this.updateById
      ..deleted = deleted ?? this.deleted
      ..enableOrNot = enableOrNot ?? this.enableOrNot
      ..scheduledStartTime = scheduledStartTime ?? this.scheduledStartTime
      ..plannedEndTime = plannedEndTime ?? this.plannedEndTime
      ..taskGrade = taskGrade ?? this.taskGrade
      ..companyCode = companyCode ?? this.companyCode
      ..taskIds = taskIds ?? this.taskIds
      ..checkType = checkType ?? this.checkType
      ..numberOfPoints = numberOfPoints ?? this.numberOfPoints
      ..taskNum = taskNum ?? this.taskNum
      ..numberOfHiddenHazardsNum = numberOfHiddenHazardsNum ?? this.numberOfHiddenHazardsNum
      ..completionRate = completionRate ?? this.completionRate
      ..theNumberOfTasksToBeCompleted = theNumberOfTasksToBeCompleted ?? this.theNumberOfTasksToBeCompleted
      ..taskStatus = taskStatus ?? this.taskStatus
      ..endTime = endTime ?? this.endTime
      ..unitPlans = unitPlans ?? this.unitPlans
      ..tasks = tasks ?? this.tasks
      ..lateNum = lateNum ?? this.lateNum
      ..reExaminationNum = reExaminationNum ?? this.reExaminationNum
      ..inspectionTypeName = inspectionTypeName ?? this.inspectionTypeName;
  }
}
